package com.fz.mapper;

import com.fz.entity.Student;
import org.apache.ibatis.annotations.*;

import java.awt.*;
import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-08-26.
 */
public interface StudentMapper {
       //查询所有数据
       // @Select("select * from student")
       public List<Student> query();

       //用map查询数据
       @Select("select * from student")
       public List<Map<String,Object>> se();


       //增加数据
       //map集合添加数据
       //@Insert("insert into student values (null,#{name},#{score},#{address})")
       public  int add(Map<String,Object> map);


       //通过实例化类添加数据
       @Insert("insert into student values (null,#{name},#{score},#{address})")
       public  int adds(Student student);


       //通过注解方式添加数据
       @Insert("insert into student values (null,#{name},#{score},#{address})")
       public  int addss(@Param("name") String name,@Param("score") int score,@Param("address") String address);


       //通过id修改name
       // @Update("update student set name=#{name} where id=#{id}")
       public int up(@Param("name") String name,@Param("id") int id);


        //通过id删除数据
        //@Delete("delete from student where id=#{id}")
        public int det(@Param("id") int id);


       //删除所有数据
       //@Delete("delete from student")
       public int dep();
     }
